<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html>
	<head>
		<title><fmt:message key="productDisplay.title" /></title>
		<script language="javascript" type="text/javascript"
			src="/zywx3/ext/scripts/display/displaypage.js">
</script>
		<script type="text/javascript">

function deleteornot() {
	var str = jQuery("#onePage").val();
	alert(str);

}

function fucCheck(INDEX) {
	var i, j, strTemp;
	strTemp = "0123456789";
	for (i = 0; i < INDEX.length; i++) {
		j = strTemp.indexOf(INDEX.charAt(i));
		if (j == -1) {
			//说明有字符不合法     
			return false;
		}
	}
	//说明合法     
	return true;
}
jQuery(function() {
	
	
	///alert(${displayallpage}+"-------"+${thispage}+"------"+${pageSize});
	
	jQuery("#displayallpage").val(${displayallpage});
	
	jQuery("#tz").val(${thispage});
	//jQuery("#product_button").attr("class", "btn_selected").val("`");//给button加样式 
	jQuery("#testinput")
			.change( function(){
			
						var str = jQuery("#testinput").val();
						var obj = document.forms[0];
						if (!fucCheck(str)) {
							alert("你输入的数字有误！");
							jQuery("#testinput").focus();
							return false;
						}else{
							if(parseInt(str) >100){
								alert("输入的数字不能大于100！");
								jQuery("#testinput").focus();
								return false;
							}else if(str==0){
								alert("输入的页数不能为零！");
								jQuery("#testinput").focus();
								return false;
							}else{
								obj.action = "/zywx3/util/productDisplay.html?pageNumber="+str;
								obj.submit();
							}
						}
			});
	
	
});

function promptfunc(str) {

	var pro_button = jQuery("#productbutton" + str);

	var property = jQuery("#productbutton" + str).attr("class");
	if (property == 'btn_selected') {
		jQuery("#productbutton" + str).attr("class", "btn_quxiao");
		jQuery("#product" + str).attr("checked", "checked");

	}
	if (property == 'btn_quxiao') {
		jQuery("#productbutton" + str).attr("class", "btn_selected");
		jQuery("#product" + str).removeAttr("checked");

	}

}
</script>
		<style>
.p_us {
	width: 82%;
	font-size: 12px;
	background: url(../../images/dian_pus.gif) no-repeat left 8px;
	padding-left: 8px;
	color: #ff5500;
	line-height: 18px;
	padding-bottom: 3px;
}

.p_us b {
	color: #556082;
	font-size: 12px;
	font-weight: normal;
	display: inline;
}
</style>
	</head>
	<body>
		<div id="content">
			<div class="box_big2">

				<form:form commandName="productDisplay" method="post"
					action="${ctx}/shopcar/productDisplay.html">

					<input type="hidden" id="pageNum" name="pageNum"
						value="${pageSize}" />


					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr height="50" valign="top">
							<td align="center">

								<input type="submit" class="btn_buy" value=""
									onmouseover="this.className='btn_buy hover'"
									onmouseout="this.className='btn_buy'" />

							</td>
							<td align="center">
								<p class="p_us">
									<font>请输入每页显示的条数：</font>
									<input type='text' class="text" name='testinput' id='testinput'
										value='${pageSize}' size="4" />
									<font>条</font>
								</p>
							</td>


						</tr>
					</table>
					<div>


						<%--<display:table name="collectinfolist" cellspacing="0"
							cellpadding="0" requestURI="" partialList="true"
							size="${resultSize}" style="width:100%;" class="table_cx"
							defaultsort="8" defaultorder="descending" id="collectInfo"
							pagesize="10" export="true"></display:table>

						--%>
						<display:table cellspacing="0" cellpadding="0" requestURI=""
							partialList="true" size="${resultSize}" id="productDisplay"
							pagesize="${pageSize}" />


					</div>
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td>
								<c:forEach var="ss" items="${display}" varStatus="i">
									<div class="chanpin_box2"
										onmouseover="this.className='chanpin_box2 hover'"
										onmouseout="this.className='chanpin_box2'">
										<div class="up_b">
											<div class="up_br">
												<div class="up_bcon"></div>
											</div>
										</div>
										<div class="chanpin_con">

											<c:forEach var="data" varStatus="j"
												items="${fn:split(ss.value,'@@@')}">
												<c:if test="${j.index==0}">
													<c:forEach var="scenestr"
														items="${fn:substringAfter(data,'###')}">
														<a
															href="${ctx}/toProductPage/oneProductDisplay.html?onePage=${scenestr}"></c:forEach>
													
													<c:forEach var="imgsrc"
														items="${fn:substringBefore(data,'###')}">
														<img style='width: 200px; height: 200px'
															src="${imgsrc}" />
													</c:forEach>
													</a>
												</c:if>

												<c:if test="${j.index==1}">
													<p>
														<fmt:message key="collect.satelliteid" />
														:
														<font>${data}</font>
												</c:if>
												<c:if test="${j.index==2}">
													<fmt:message key="collect.sensorid" />:<font>${data}</font>
													</p>
												</c:if>
												<c:if test="${j.index==3}">
													<p>
														<fmt:message key="product.collectdate" />
														:
														<font>${data}</font>
													</p>
												</c:if>

											</c:forEach>
											<c:forEach var="status" varStatus="j"
												items="${fn:split(ss.value,'@@@')}">
												<c:if test="${j.index==4}">
													<c:if test="${status=='read'}"></c:if>
													<c:if test="${status=='yes'}">
														<input name="" type="button" class="btn_buyed" />
													</c:if>
													<c:if test="${status=='no'}">
														<input id="productbutton${ss.key}" type="button"
															class="btn_selected" onclick='promptfunc("${ss.key}")' />
														<input style="visibility: hidden" type="checkbox"
															id="product${ss.key}" name="productid" value="${ss.key}" />
													</c:if>
												</c:if>
											</c:forEach>
										</div>
										<div class="di_b">
											<div class="up_br">
												<div class="up_bcon"></div>
											</div>
										</div>
									</div>
								</c:forEach>
							</td>
						</tr>
					</table>
				</form:form>
			</div>
		</div>
	</body>
</html>
